package loader.persister;

import java.sql.Connection;
import java.sql.DriverManager;

public class ConnectionManager {
	private String url;
	private String user;
	private String pws;
	private Connection conn;

	public ConnectionManager() {
		url="jdbc:mysql://localhost/pm?useUnicode=true&characterEncoding=utf-8";
		user="root";
		pws="";
		conn=null;
	}

	public Connection getConnection() {
		try { 
			Class.forName("com.mysql.jdbc.Driver").newInstance();
			conn=DriverManager.getConnection(url,user,pws);
	    } 
		catch (Exception e) {
			System.err.println("Error occurred obtaining connection");
			System.out.println(e);
		}
		return conn;
	}
}
